#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	int n;
	cin >> n;
	char arr[60];
	getchar();
	while (n--)
	{
		bool flag = true;
		fgets(arr, 60, stdin);
		int len = strlen(arr)-1;
		if (!((arr[0] >= 'a' && arr[0] <= 'z') || (arr[0] >= 'A' && arr[0] <= 'Z') ||( arr[0] == '_')))
		{
			flag = false;
		}
		else
		{
			for (int i = 0; i < len; i++)
			{
				if (!((arr[i] >= '0' && arr[i] <= '9') || (arr[i] >= 'a' &&
					arr[i] <= 'z') || (arr[i] >= 'A' && arr[i] <= 'Z') || (arr[i] == '_')))
				{
					flag = false;
					break;
				}
			}
		}
		if (flag) {
			cout << "yes" << endl;
		}
		else
		{
			cout << "no" << endl;
		}
	}
	return 0;
}